package com.wb.controller;

import com.wb.fegin.DemoFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName Consumer1Controller
 * @Description TODO
 * @Author wangBo
 * @Date 2019/6/23 0023 上午 8:11
 * @Version 1.0
 */
@RestController(value = "consumer1")
public class Consumer1Controller {

    private final Logger logger = LoggerFactory.getLogger(Consumer1Controller.class);

    @Value("${spring.application.name:${vcap.application.name:${spring.config.name:application}}}")
    private String name;

    @Autowired
    private DemoFeignClient demoFeignClient;

    @RequestMapping(value = "/sendMsg",method = RequestMethod.GET)
    public String sendMes() {
        logger.info("name : {}" , name);
        String result = demoFeignClient.sendMsg(1L);
        logger.info("result : {} " , result);
        return result;
    }
}